import 'package:cream_chat_flutter/globals/ThemeProvider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:provider/provider.dart';

import 'HomeTabPageProvider.dart';

class BuildBanner extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _BuildBannerState();
}

class _BuildBannerState extends State<BuildBanner> {
  @override
  Widget build(BuildContext context) {
    return Consumer2(
        builder: (BuildContext context, ThemeProvider tp,
                HomeTabPageProvider htp, Widget child) =>
            ClipRRect(
              borderRadius: BorderRadius.all(tp.getNmRadius()),
              child: Swiper(
                itemBuilder: (BuildContext context, int index) {
                  return new Image.network(
                      "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.51tietu.net%2Fupload%2Fwww.51tietu.net%2F2013-8%2F201308151430334316.jpg&refer=http%3A%2F%2Fimg.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1624964332&t=c65d8ff5b8573347e331350d0f63b56b",
                      height: 300,
                      fit: BoxFit.cover);
                },
                itemCount: 3,
                pagination: new SwiperPagination(),
              ),
            ));
  }
}
